package com.action;

import java.sql.ResultSet;

import com.opensymphony.xwork2.ActionSupport;
import com.util.DB;

public class sellerpaisapay extends ActionSupport


{
	
	private String payeename;
	private Integer accntno;
	public void setAccntno(Integer accntno) {
		this.accntno = accntno;
	}



	public void setMcir(Integer mcir) {
		this.mcir = mcir;
	}


	private String bankname;
	private String city;
	private String branch;
	private Integer mcir;
	
	
	
	
	public String getPayeename() {
		return payeename;
	}



	public void setPayeename(String payeename) {
		this.payeename = payeename;
	}






	public String getBankname() {
		return bankname;
	}



	public void setBankname(String bankname) {
		this.bankname = bankname;
	}



	public String getCity() {
		return city;
	}



	public void setCity(String city) {
		this.city = city;
	}



	public String getBranch() {
		return branch;
	}



	public void setBranch(String branch) {
		this.branch = branch;
	}



	
	ResultSet res,res1,res2;
	
	public String execute()throws Exception
	{
		
		
		String query="select * from bank;";
		res=DB.readFromBmtcDB(query);
		System.out.println("res is"+res);
		while(res.next())
		{
			String payeename1=res.getString("payeename");
			Integer accntno1=res.getInt("accntno");
			String bankname1=res.getString("bankname");
			String city1=res.getString("city");
			String branch1=res.getString("branch");
			Integer mcir1=res.getInt("mcir");
			
			System.out.println("the pn1 is"+payeename1);
			System.out.println("the pn is"+payeename);
			
			System.out.println("the an1 is"+accntno1);
			System.out.println("the an is"+accntno);
			
			
			if(payeename1.equalsIgnoreCase(payeename) && bankname1.equalsIgnoreCase(bankname) && city1.equalsIgnoreCase(city) && branch1.equalsIgnoreCase(branch))
			{
				System.out.println("after paye comparison");
				 if(accntno1.equals(accntno) && mcir1.equals(mcir))
					 
				 {
					 System.out.println("after account comparison");
					 return "success";
				 }
				
				 return "wrong";
				
			}
				
			
		}
		
		return "wrong";
	}

}
